Self-inferencing Reflection Resolution for Java
نویسندگان
چکیده
C o n si st en t * lete * W ll D o c u m e n t e d * E a s y t o R e u s e * * E v a l u a t e d * E C O O P * Ar tifact * A E C Reflection has always been an obstacle both for sound and for effective under-approximate pointer analysis for Java applications. In pointer analysis tools, reflection is either ignored or handled partially, resulting in missed, important behaviors. In this paper, we present our findings on reflection usage in Java benchmarks and applications. Guided by these findings, we introduce a static reflection analysis, called Elf, by exploiting a self-inferencing property inherent in many reflective calls. Given a reflective call, the basic idea behind Elf is to automatically infer its targets (methods or fields) based on the dynamic types of the arguments of its target calls and the downcasts (if any) on their returned values, if its targets cannot be already obtained from the Class, Method or Field objects on which the reflective call is made. We evaluate Elf against Doop’s state-of-the-art reflection analysis performed in the same context-sensitive Andersen’s pointer analysis using all 11 DaCapo benchmarks and two applications. Elf can make a disciplined tradeoff among soundness, precision and scalability while also discovering usually more reflective targets. Elf is useful for any pointer analysis, particularly under-approximate techniques deployed for such clients as bug detection, program understanding and speculative compiler optimization.
منابع مشابه
Pluggable checking and inferencing of nonnull types for Java
We have implemented a non-null type checker for Java and a new non-null inferencing algorithm for analyzing legacy code. The tools are modular extensions to the JastAdd extensible Java compiler, illustrating how pluggable type systems can be achieved. The resulting implementation is compact, less than 230 lines of code for the non-null checker and 460 for the inferencer. Non-null checking is a ...
متن کاملReflection Analysis for Java
Reflection has always been a thorn in the side of Java static analysis tools. Without a full treatment of reflection, static analysis tools are both incomplete because some parts of the program may not be included in the application call graph, and unsound because the static analysis does not take into account reflective features of Java that allow writes to object fields and method invocations...
متن کاملThe Effect of Self-Regulation on Improving EFL Readers’ Ability to Make Within-Text Inferences
Self-regulation is the ability to regulate one’s cognition, behavior, actions, and motivation strategically and autonomously in order to achieve self-set goals including the learning of academic skills and knowledge. Accordingly, self-regulated learning involves self-generated and systematic thoughts and behaviors with the aim of attaining learning goals. With that in mind, this study aimed to ...
متن کاملImproving the Static Resolution of Dynamic Java Features
In Java software, two important flexibility mechanisms are dynamic class loading and reflection. Unfortunately, the vast majority of static analyses for Java handle these features either unsoundly or overly conservatively. Our work targets techniques that will increase static analyses’ ability to handle dynamic features in a more precise
متن کاملntrospective-SystemC: Reflection and Introspection in System Level Design
Reflection is an increasingly important feature in software systems as evidenced by introduction of datatype reflection abilities in Java, RTTI runtime type information reflection package for C++, and reflection service in .NET environment. Since systems being designed today are supposed to self-configure, self-heal and make a lot more intelligent decisions about itself, including versioning, f...
متن کامل